<template>

  <div style="width:100%; padding:10px;"> <br><br><br><br>
    <p style="text-align: center; margin:auto; padding: 20px 50px 20px 0px;"> <span
        style="font-size:26px; font-weight:700;">东莞市厚街医院</span> <br> <span
        style="font-size:26px; font-weight:700;">临床发血单</span> </p>
    <table style="border-collapse: collapse; width:90%; left:20px;position:relative;">
      <tr>
        <td style="text-align:left;"> <span style="font-weight:600;">
            姓名：</span>{{item.traPatient.name}}</td>
        <td style="text-align:left;"> <span style="font-weight:600;">
            性别：</span>{{getEnum("BasSex",item.traPatient.sex) }}</td>
        <td style="text-align:left;"> <span style="font-weight:600;">
            年龄：</span>{{item.traPatient.age}}</td>
      </tr>
      <tr>
        <td style="text-align:left;"> <span style="font-weight:600;">
            患者ID：</span>{{item.traPatient.hospitalNumber}}</td>
        <td style="text-align:left;"> <span style="font-weight:600;">
            患者病区：</span>{{getBasMaterial("Department",item.traPatient.dependency) }}</td>
        <td style="text-align:left;"> <span style="font-weight:600;">
            床号：</span>{{item.traPatient.berth}} </td>
      </tr>
      <tr>
        <td v-if="  item.reviewDetail.aboResult === undefined " style="text-align:left;">
          <span style="font-weight:600;"> 患者血型：</span>
          {{  item.traPatient.abo  }} , {{ item.traPatient.rhD  }}
        </td>
        <td v-else style="text-align:left;">
          <span style="font-weight:600;"> 患者血型：</span>
          {{  item.reviewDetail.aboResult  }} ,{{ item.reviewDetail.rhDResult }}
        </td>
        <td style="text-align:left;" colspan="2"> <span style="font-weight:600;">
            申请医生：</span>{{getUserName(item.traMaster.creatorUserId)}}</td>
      </tr>
      <tr>
        <td style="text-align:left;" colspan="3"> <span style="font-weight:600;">
            临床诊断：</span>{{item.traPatient.clinicDiagnose}}</td>
      </tr>
    </table>
    <table style="border-collapse: collapse; width:95%;margin-top:5px;position:relative;">
      <tr>
        <td style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">血液流水号</td>
        <td style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">血型</td>
        <td style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">容量</td>
        <td style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">血液品种</td>
        <td v-if="item.traDetail.basBloodVariety.isCrossMatch==true"
          style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">配血结果</td>
        <td style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">血制品有效期</td>
        <td style="border:1px solid black; text-align: center;font-weight:600;width:25%;font-size:15px">
          献血码粘贴处</td>
        <td style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">输血前核对</td>
      </tr>
      <tr v-for="(message,i) in list" :key="i">
        <td style="border:1px solid black; text-align: center;font-size:15px">
          {{message.invBloodInfo.bloodDonationCode}}<br>{{message.invBloodInfo.basBloodProductId}}</td>
        <td style="border:1px solid black; text-align: center;font-size:15px">
          {{message.invBloodInfo.abo}}<br>
          RhD({{message.invBloodInfo.rhD}})</td>
        <td style="border:1px solid black; text-align: center;font-size:15px">
          {{message.invBloodInfo.volume}}{{message.invBloodInfo.unit}}</td>
        <td style="border:1px solid black; text-align: center;font-size:15px">
          {{message.invBloodInfo.basBloodProduct.name}}</td>
        <td v-if="item.traDetail.basBloodVariety.isCrossMatch==true"
          style="border:1px solid black; text-align: center;font-size:15px">
          {{ getEnum("TraCrossMatchResult",message.result)}}</td>
        <td style="border:1px solid black; text-align: center;font-size:15px">
          {{message.invBloodInfo.effectiveDate.slice(0, 10)}}<br>
          {{message.invBloodInfo.effectiveDate.slice(11, 16)}} </td>
        <td style="border:1px solid black; text-align: center;;font-size:15px"></td>
        <td style="border:1px solid black; text-align: center;font-size:15px"></td>
      </tr>
      <tr>
        <td colspan="9" id="heji" style="border:1px solid black;text-align:left;font-size:15px"><span
            style="">备注：</span>{{item.master.remark}}</td>
      </tr>
    </table>
    <table style="border-collapse: collapse;width:90%;left:20px;margin-top:20px;position:relative;">
      <tr>
        <td style="text-align:left;width:50%;"> <span style="font-weight:600;">
            发血人：</span>{{getUserName(item.master.sendUserId)}}</td>
        <td style="text-align:left;width:50%;"> <span style="font-weight:600;">
            发血时间：</span>{{item.master.creationTime}}</td>
      </tr>
      <tr>
        <td style="text-align:left;width:50%;"> <span style="font-weight:600;">
            取血人：</span>{{getUserName(item.master.receiveUserId)}}</td>
        <td style="text-align:left;width:50%;"> <span style="font-weight:600;">
            取血时间：</span></td>
      </tr>
    </table>
    <table v-if="item.isXR===true"
      style="border-collapse: collapse;width:760px;left:20px;margin-top:20px;position:relative;">
      <tr>
        <td style="text-align:left;">紧急发放-相容性检测实验未完成</td>
      </tr>
    </table>
  </div>

</template>

<script>
export default {
  name: "NursingPrint",
  methods: {
    //getBasMaterial(UserId)  //根据用户ID获取用户名
    getUserName() {
      return "username"
    },

    //getEnum("BasSex",id) //获取枚举名称
    getEnum() {
      return "未知"
    },

    //getBasMaterial("Department",id) //获取部门
    //getBasMaterial("BloodVariety",id) //获取血液品种名称
    //getBasMaterial("BloodVariety",id) //获取血液产品名称
    getBasMaterial() {
      return "xxx"
    },
  },
  data: function () {
    return {
      item: {
        traPatient: {
          billNo: "APL200803019",
          patientId: "615452",
          hospitalNumber: "7845261",
          name: "4445",
          sex: 0,
          age: "86岁",
          birthday: "2014-08-27",
          dependency: "0302",
          apanage: 0,
          abo: "A",
          rhD: "+",
          transfuseHistory: 0,
          reactionHistory: 0,
          gestationHistory: 0,
          parturitionHistory: 0,
          transplantMatchHistory: 0,
          basDepartmentId: "836999",
          basSingleDiseaseId: null,
          patientType1: 1,
          patientType2: 2,
          isWrittenConsent: true,
          berth: "8041",
          clinicDiagnose: "消化不良",
          traAim: "纠正血小板数量减少或功能异常",
          result: "未知",
          visitId: "0",
          traZyzt: 0,
          personII: "未知",
          admitDate: "2020-08-03",
          visitCount: 14,
          clinicDiagnoseCode: "K30.x00",
          cardCode: null,
          irregularAntibody: false,
          info1: null,
          info2: null,
          info3: null,
          info4: null,
          info5: null,
        },
        traDetail: {
          billNo: "APL200803019",
          basBloodVarietyId: 1,
          applyBloodType: "A",
          applyRhD: "+",
          applySum: 2,
          specialProcessing: null,
          replaceBloodVarietyId: null,
          remark: null,
          beforeSurgery: null,
          otherIllustrates: null,
          isTypeReview: false,
          basSxhlx: 0,
          varietyNorm: null,
          traSpecimenInfoId: 161,
          hasSum: 1.5,
          bloodOutSum: 1.5,
          basBloodVariety: {
            lastModifierUserId: null,
            lastModificationTime: null,
            code: "1",
            name: "悬浮红细胞",
            isEnabled: true,
            unit: "u",
            isCrossMatch: true,
            basXyzl: 1,
            isQuantity: true,
            unitRate: 200,
            expirationTime: 3,
            id: 1,
          },
        },
        traMaster: {
          isOutpatient: 0,
          middleAuditUserId: 10006,
          middleAuditTime: "2020-08-03 17:10:57",
          middleAuditInfo: null,
          billNo: "APL200803019",
          manualNo: null,
          billType: null,
          billStatus: 3,
          auditUserId: 9323,
          auditInfo: "",
          auditTime: "2020-08-03 17:14:05",
          applyType: 2,
          isExigence: false,
          perTranTime: "2020-08-03 20:09:42",
          auditLevel: 2,
          traType: 5,
          traPerAppraiseBillNo: "",
          isDeleted: false,
          deleterUserId: null,
          deletionTime: null,
          lastModificationTime: "2020-08-03 17:17:29",
          lastModifierUserId: 9323,
          creationTime: "2020-08-03 17:10:31",
          creatorUserId: 10558,
          id: "APL200803019",
        },
        basPatient: {
          id: "615452",
          hospitalNumber: "7845261",
          name: "4445",
          sex: 0,
          age: "86岁",
          birthday: "2014-08-27",
          apanage: 0,
          abo: "A",
          rhD: "+",
          transfuseHistory: 0,
          reactionHistory: 0,
          gestationHistory: 0,
          parturitionHistory: 0,
          transplantMatchHistory: 0,
          matchHistory: 0,
          lastTypeReviewBillNo: "REV200804001",
          lastTypeReviewTime: "2020-08-04 15:41:06",
          typeReviewBillDetail: {
            billNo: "REV200804001",
            aboPositive: "A",
            aboNegative: "A",
            aboResult: "A",
            aboBloodTyping: 18,
            rhBloodTyping: 19,
            subtype: null,
            rhDResult: "+",
            antibodyScreen1: null,
            antibodyScreen2: null,
            antibodyScreen3: null,
            antibodyScreenResult: null,
            antiHumanGlobulin: null,
            plAntiScreen: null,
            plInspectDate: null,
          },
          personII: "未知",
        },
        reviewDetail: {
          billNo: "REV200803003",
          aboPositive: "A",
          aboNegative: "A",
          aboResult: "A",
          aboBloodTyping: 18,
          rhBloodTyping: 19,
          subtype: null,
          rhDResult: "+",
          antibodyScreen1: 0,
          antibodyScreen2: 0,
          antibodyScreen3: 0,
          antibodyScreenResult: 1,
          antiHumanGlobulin: 0,
          plAntiScreen: 0,
          plInspectDate: "2020-08-03 17:14:41",
        },
        reviewMaster: {
          traApplyBillNo: "APL200803019",
          reCheckUserId: null,
          checkUserId: 9323,
          checkTime: "2020-08-03 17:14:30",
          billNo: "REV200803003",
          manualNo: null,
          billType: null,
          billStatus: 3,
          auditUserId: 9323,
          auditTime: "2020-08-03 17:15:04",
          remark: null,
          basDepartmentId: null,
          hospitalNumber: null,
          dependency: null,
          berth: null,
          patientName: null,
          isDeleted: false,
          deleterUserId: null,
          deletionTime: null,
          lastModificationTime: "2020-08-03 17:15:04",
          lastModifierUserId: 9323,
          creationTime: "2020-08-03 17:14:46",
          creatorUserId: 9323,
          id: "REV200803003",
        },
        master: {
          billNo: "BOU200803002",
          manualNo: null,
          billType: null,
          billStatus: 3,
          auditUserId: null,
          auditTime: "2020-08-03 17:17:29",
          remark: null,
          traApplyBillNo: "APL200803019",
          beforeTemperature: null,
          receiveUserId: 9825,
          informReceiveDate: null,
          creatorUserId: 9323,
          creationTime: "2020-08-03 17:16:34",
          sendUserId: 9134,
          isBloodOut: true,
          traTypeReviewBillNo: "REV200803003",
          basDepartmentId: "836999",
          hasSum: null,
        },
        reportTime: "2020-08-05 17:47:28",
        matchingUserName: "测试",
        reviewUserName: "测试2",
      },
      name: "血液交叉配血报告单",
      list: [
        {
          billNo: "BOU200803002",
          invBloodInfoId: 97,
          traPxffId: 16,
          reviewTraPxffId: null,
          result: 0,
          matchingDate: "2020-08-03 17:16:02",
          traCrossMatchBillNo: "MAT200803003",
          invBloodInfo: {
            code: "440142009445921D1100600",
            ownNumber: null,
            basBloodProductId: "D1100600",
            basBloodProductName: null,
            abo: "A",
            rhD: "+",
            volume: 1.5,
            unit: "u",
            warehousingPrice: 315,
            status: 1,
            specialProcessing: null,
            effectiveDate: "2020-08-12 11:36:00",
            gatheringDate: "2020-07-08 11:36:00",
            makeDate: null,
            bloodDonationCode: "440142009445921",
            isRecycle: false,
            basBloodProduct: {
              id: "D1100600",
              code: "D1100600",
              name: "红细胞悬液1.5u",
              basBloodVarietyId: 1,
              basBloodVarietyName: "红细胞",
              volume: 1.5,
              price: 315,
              femininePrice: 945,
              xzPrice: 315,
              hisCode: "62492",
              isEnabled: true,
              lastModifierUserId: null,
              lastModificationTime: null,
              creatorUserId: 2,
              creationTime: "2020-07-14 14:28:00",
              basBloodVariety: null,
            },
            sinceNumber: null,
            bloodAppearance: null,
            isDeleted: false,
            deleterUserId: null,
            deletionTime: null,
            lastModificationTime: "2020-08-03 17:17:29",
            lastModifierUserId: 9323,
            creationTime: "2020-07-22 10:46:42",
            creatorUserId: 9323,
            id: 97,
          },
          isReturn: false,
          traTscl: null,
        },
      ],
    }
  },
}
</script>
